added SSCLI 1.0
[windows-sources.git] / shared source / wpf / src / host / shimimpl / classfactory.hxx
blob2c5b02db2ae7b004615a4b719a319b61fe760fec
1 //+-----------------------------------------------------------------------
2 //
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 //
5 // Description:
6 // Defines the ClassFactory of PresentationHost.
7 //
8 // History:
9 // 2002/06/12-murrayw
10 // Created
11 // 2007/09/20-[....]
12 // Ported Windows->DevDiv. See SourcesHistory.txt.
14 //------------------------------------------------------------------------
16 #pragma once
18 //******************************************************************************
20 // CClassFactory class definition
22 //******************************************************************************
24 #define MAX_TOKENS 2
26 class CClassFactory : public IClassFactory
28 protected:
29 static DWORD s_dwRegistrationToken[MAX_TOKENS];
30 static LPCLSID s_clsIdActivated;
32 protected:
33 REFCLSID m_clsId;
34 DWORD m_ObjRefCount;
36 HRESULT RegisterClassObject(DWORD& dwRegistrationToken);
37 void SetActivatedClsId(__in REFCLSID clsId) { s_clsIdActivated = (LPCLSID) &clsId; }
39 private:
40 CClassFactory(const CClassFactory &src); // not implemented
41 void operator=(const CClassFactory &src); // not implemented
42 public:
43 CClassFactory(__in REFCLSID clsId);
44 ~CClassFactory();
46 // Methods for registering/unregistering CLSIDs
47 static HRESULT RegisterClassObjects();
48 static void RevokeAllClassObjects();
49 static LPCLSID GetActivatedClsId() { return CClassFactory::s_clsIdActivated; }
51 //IUnknown methods
52 STDMETHODIMP QueryInterface(REFIID, __out LPVOID*);
53 STDMETHODIMP_(DWORD) AddRef();
54 STDMETHODIMP_(DWORD) Release();
56 //IClassFactory methods
57 STDMETHODIMP CreateInstance(__in LPUNKNOWN, REFIID, __out LPVOID*);
58 STDMETHODIMP LockServer(BOOL);